package homework.clazz.Demo5;

public class Tiangle  extends Shape{

private double lengthofside;
private double hight;
private  String name;

    public Tiangle(String name,  double lengthofside, double hight) {
        super(name);

        this.lengthofside = lengthofside;
        this.hight = hight;
    }
    @Override
    public double getArea()//实现抽象方法
    {
    return (hight*lengthofside)/2;
    }

    @Override
    public double getLength() {
        return 3*lengthofside;
    }
}
